package com.itheima.stock.mapper;

import com.itheima.stock.common.domain.InnerMarketDomain;
import com.itheima.stock.common.domain.StockInfoConfig;
import com.itheima.stock.pojo.StockMarketIndexInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author a
* @description 针对表【stock_market_index_info(国内大盘数据详情表)】的数据库操作Mapper
* @createDate 2022-05-08 16:06:48
* @Entity com.itheima.stock.pojo.StockMarketIndexInfo
*/
@Mapper
public interface StockMarketIndexInfoMapper {

    int deleteByPrimaryKey(Long id);

    int insert(StockMarketIndexInfo record);

    int insertSelective(StockMarketIndexInfo record);

    StockMarketIndexInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StockMarketIndexInfo record);

    int updateByPrimaryKey(StockMarketIndexInfo record);

    //根据时间点和大盘编码查询信息
    List<InnerMarketDomain> findMarketInfoByTimeANdCodes(@Param("curTime") Date curDate, @Param("marketCodes") List<String> codes);

    /**
     * 查询t和t-1的成交量
     * @param inner 大盘id
     * @param tStartTime 开盘时间
     * @param tEndTime 当前时间
     * @return
     */
    List<Map> getTradeVolT(@Param("marketCode") List<String> inner, @Param("startTime") Date tStartTime, @Param("endTime") Date tEndTime);

    //批量插入数据
    int insertBatch(@Param("infos") List<StockMarketIndexInfo> infos);
}
